package com.yasenagat.zkweb.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Map;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Tree {

    private int id;
    private String text;
    //state: node state, 'open' or 'closed', default is 'open'. When set to 'closed', the node have children nodes and will load them from remote site
    private String state;

    public static final String STATE_OPENNED = "open";
    public static final String STATE_CLOSED = "closed";
    private List<Tree> childern;
    //checked: Indicate whether the node is checked selected.
    private Boolean checked;
    //attributes: custom attributes can be added to a node
    private Map<String, Object> attributes;


    public Tree(int id, String text, String state, List<Tree> childern,
                Map<String, Object> attributes) {
        super();
        this.id = id;
        this.text = text;
        this.state = state;
        this.childern = childern;
        this.attributes = attributes;
    }


    public Tree(int id, String text, String state, List<Tree> childern) {
        super();
        this.id = id;
        this.text = text;
        this.state = state;
        this.childern = childern;
    }


}
